package com.tuanzi.loan.web.lazy.system;

import com.tuanzi.loan.business.service.system.PartnerService;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.system.PartnerSearchRequest;
import com.tuanzi.loan.vo.response.system.PartnerSearchResponse;
import com.tuanzi.loan.web.bean.CurrentUserBean;
import com.tuanzi.loan.web.lazy.LazyDataSessionModel;
import org.springframework.data.domain.Page;

/**
 * @author Ray 2017/09/21
 */
public class PartnerLazyDataModel extends LazyDataSessionModel<PartnerSearchRequest, PartnerSearchResponse> {

	private static final long serialVersionUID = 9143007553234885156L;

	private PartnerService partnerService;

	public PartnerLazyDataModel(PartnerSearchRequest partnerSearchRequest, CurrentUserBean session, PartnerService partnerService) {
		super(partnerSearchRequest, session);
		this.partnerService = partnerService;
	}

	@Override
	protected Page<PartnerSearchResponse> doLoad0(PageSearcher<PartnerSearchRequest> pageSearcher) {
		return partnerService.list(pageSearcher);
	}

}
